package com.aier.admin_new.action;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.aier.admin_new.service.IRoleService;
import com.aier.common.common.SystemConfigStatic;

@Scope("prototype")
@Component("sysbasseMessageAction")
public class SysbasseMessageAction  extends AdminNewBaseAction {
    @Resource(name="roleService")
    private IRoleService roleService;
    
	private int s;
	private String error_info;
	private int vesion;
	private int isUpadte;
	private String url;
	
	private String appLog;//日志记录

	/**
	 * app端检查版本更新
	 * @return
	 */
	public String checkVesion(){
		int newvesion=roleService.searchAppVesion();
		s=0;
		error_info="版本号不存在";
		if(newvesion==vesion){
			s=1;
			error_info="";
			isUpadte=0;
			vesion=0;
			url="";
		}else{
			s=1;
			isUpadte=1;
			vesion=newvesion;
			error_info="";
			url="http://file.aier360.com//aier360.apk";
		}
		return SUCCESS;
	}
	
	/**
	 * 保存applog
	 * @return
	 */
	public String saveAppLog(){
		String dataurl = data_url;
		
		return SUCCESS;
	}
	

	public int getS() {
		return s;
	}

	public String getError_info() {
		return error_info;
	}

	public int getIsUpadte() {
		return isUpadte;
	}

	public String getUrl() {
		return url;
	}

	public void setVesion(int vesion) {
		this.vesion = vesion;
	}
	
	public int getVesion() {
		return vesion;
	}

	public void setAppLog(String appLog) {
		this.appLog = appLog;
	}
}
